//调用这个函数的时候，会得到替换后的字符串
//type 打印类型，type等于0贷记回执打印，type等于1执行轧帐清单，type等于2执行轧帐总数处理 ,type等于3支票回执打印 ,type等于5同城支付回执打印 ,type等于7 包商支票回执打印
function p_print(str, strs, type) {
	//http://localhost:8080/bin-debug/
	var url0 = "lsreport/DJPZHZ.html";
	var url1 = "lsreport/AJLQD.html";
	var url2 = "lsreport/AZZQDZS.html";
	var url3 = "lsreport/DZPHZ.html";
	var url4 = "lsreport/DTCZFPZ.html";
	var url5 = "lsreport/DJSYWPZ.html";
	var url6 = "lsreport/CSJZD.html";
	var url7 = "lsreport/BSZPHZ.html";
	var url8 = "lsreport/SZAZZQDZS.html";
	var p_content0;// 返回需要打印时的字符串
	if (type == "0") {// 贷记凭证回执打印
		// ajax请求
		var html = $.ajax({
			url : url0,
			async : false
		}).responseText;
		var arr = new Array();
		arr = str.split("@");
		if (html != "" && html.length > 0) {
			p_content0 = html.replace("**AAAAA**", arr[0]).replace("**BBBBB**",
					arr[1]).replace("**CCCCC**", arr[2]).replace("**DDDDD**",
					arr[3]).replace("**EEEEE**", arr[4]).replace("**FFFFF**",
					arr[5]).replace("**GGGGG**", arr[6]).replace("**HHHHH**",
					arr[7]).replace("**IIIII**", "1").replace("**JJJJJ**", "1")
					.replace("**KKKKK**", "1").replace("**LLLLL**", "1")
					.replace("**path1**", arr[8]).replace("**path2**", arr[9])
					.replace("**MMMMM**", arr[0]);
			return p_content0;
		} else {
			return false;
		}

	} else if (type == "1") {
		// 轧帐总数
		var htmlZS = $.ajax({
			url : url2,
			async : false
		}).responseText;
		var ZS = htmlZS;
		if (htmlZS != "" && htmlZS.length > 0) {
			ZS = htmlZS.replace("**AAAAA**", strs[0].date).replace("**BBBBB**",
					strs[0].time).replace("**CCCCC**", strs[0].acceptnotenum).replace(
					"**DDDDD**", strs[0].hzdyssum).replace("**EEEEE**", strs[0].hddaysum)
					.replace("**FFFFF**", strs[0].historyinfo).replace("**GGGGG**",
							strs[0].dianziguiyuan).replace("**HHHHH**", strs[0].page).replace(
							"**IIIII**", strs[0].zzpch).replace("**JJJJJ**",
							strs[0].checknum).replace("**KKKKK**", strs[0].jzdnum).replace(
							"**LLLLL**", strs[0].djpz12).replace("**MMMMM**",
							strs[0].djpz34).replace("**NNNNN**", strs[0].tczfnum).replace(
							"**OOOOO**", strs[0].jsywsqsnum).replace("**PPPPP**",
							strs[0].hddaycount);
		}
		var myobj = str;// 解析json格式的数据 轧帐清单
		var html = $.ajax({
			url : url1,
			async : false
		}).responseText;
		if (html != "" && html.length > 0) {
			var temp = "";// 需要替换的模版
			var tempstr = html;
			var lengths = myobj.length;// 获取长度
			var pageNum = 24;// 每页要显示的个数
			var pageCount = 0;// 总页数
			//var currentPage;// 当前页数
			if (lengths % pageNum > 0) {
				pageCount = (lengths - (lengths % pageNum)) / pageNum + 1;// 取模运算出总页数
			} else {
				pageCount = lengths / pageNum;
			}
			var reg0 = new RegExp("\\*\\*DDDDD\\*\\*", "g");// 为填充的数据为空
			var reg1 = new RegExp("\\*\\*EEEEE\\*\\*", "g");
			var reg2 = new RegExp("\\*\\*FFFFF\\*\\*", "g");
			var reg3 = new RegExp("\\*\\*GGGGG\\*\\*", "g");
			var reg4 = new RegExp("\\*\\*HHHHH\\*\\*", "g");
			var reg5 = new RegExp("\\*\\*result\\*\\*", "g");
			var data1 = strs[0].date;
			var data2 = strs[0].time;
			// 在此要做分页，更具myobj传过来的数据量，进行分页打印
			var d1;
			var d2;
			var d3;
			var d4;
			var d5;
			var d7;
			var objlen = myobj.length;// 总长度
			var templen = 0;// 需要打印的长度
			for ( var j = 0; j < pageCount; j++) {
				tempstr = html.replace("**AAAAA**", strs[0].zzpch).replace(
						"**BBBBB**", strs[0].historyinfo).replace("**CCCCC**",
						data1 + " " + data2).replace("**page1**", j + 1)// 当前页
				.replace("**page2**", pageCount);
				if (pageCount == 1) {
					templen = myobj.length;
				} else {
					if (objlen >= templen) {
						templen = myobj.length
								- (myobj.length - pageNum * (j + 1));
						objlen = objlen - templen / (j + 1);
					} else {
						templen = myobj.length;
					}
				}
				for ( var aa = pageNum * j; aa < templen; aa++) {
					d1 = myobj[aa].no;
					d2 = myobj[aa].PAYEEACCNO;
					d3 = myobj[aa].PAYEENAME;
					d4 = myobj[aa].trantype;
					d5 = myobj[aa].result;
					d7 = myobj[aa].time;
					tempstr = tempstr.replace("**DDDDD**", d1).replace(
							"**EEEEE**", d2).replace("**FFFFF**", d3).replace(
							"**GGGGG**", d4).replace("**result**", d5).replace(
							"**HHHHH**", d7);
				}
				temp = temp + tempstr;
			}

			temp = temp.replace(reg0, "").replace(reg1, "").replace(reg2, "")
					.replace(reg3, "").replace(reg4, "").replace(reg5, "");
			p_content0 = ZS + temp;
			
			// CreateFile(p_content0)
		} else {
			return false;
		}
		// if(lengths>=24){
		// return p_content0.substring(p_content0.indexOf("@@@"), strs.length -
		// 1);
		// }else{		
		// }
		return p_content0;
	} else if (type == "3") {// 支票回执打印
		var html = $.ajax({
			url : url3,
			async : false
		}).responseText;
		var arr = new Array();
		arr = str.split("@");
		if (html != "" && html.length > 0) {
			p_content0 = html.replace("**AAAAA**", arr[0]).replace("**BBBBB**",
					arr[12]).replace("**CCCCC**", arr[2]).replace("**DDDDD**",
					arr[3]).replace("**EEEEE**", arr[4]).replace("**FFFFF**",
					arr[5]).replace("**GGGGG**", arr[6]).replace("**HHHHH**",
					arr[7]).replace("**IIIII**", "1").replace("**JJJJJ**", "1")
					.replace("**KKKKK**", "1").replace("**LLLLL**", "1")
					.replace("**path1**", arr[8]).replace("**path2**", arr[9])
					.replace("**path3**", arr[10]).replace("**MMMMM**", arr[11]).replace("**path4**", arr[13]);
			return p_content0;
		} else {
			return false;
		}
	} else if (type == "8") {
		// 苏州--轧帐--只有汇总信息
		var htmlZS = $.ajax({
			url : url8,
			async : false
		}).responseText;
		var ZS = htmlZS;
		if (htmlZS != "" && htmlZS.length > 0) {
			ZS = htmlZS.replace("**AAAAA**", strs[0].date)
						.replace("**BBBBB**",strs[0].time)
						.replace("**CCCCC**", strs[0].acceptnotenum)
						.replace("**DDDDD**", strs[0].hzdyssum)
						.replace("**EEEEE**", strs[0].hddaysum)
						.replace("**FFFFF**", strs[0].historyinfo)
						.replace("**GGGGG**",strs[0].dianziguiyuan)
						.replace("**HHHHH**", strs[0].page)
						.replace("**IIIII**", strs[0].zzpch)
						.replace("**JJJJJ**",strs[0].checknum)
						.replace("**KKKKK**", strs[0].jzdnum)
						.replace("**LLLLL**", strs[0].djpz12)
						.replace("**MMMMM**",strs[0].djpz34)
						.replace("**NNNNN**", strs[0].dhpznum)
						.replace("**PPPPP**",strs[0].hddaycount)
						.replace("**QQQQQ**",strs[0].b01)
						.replace("**RRRRR**",strs[0].b02)
						.replace("**SSSSS**",strs[0].b03)
						.replace("**TTTTT**",strs[0].b04)
						.replace("**UUUUU**",strs[0].b05);
		}
		return ZS;
	} else if (type == "7") {// 包商支票回执打印
	 //  alert("222222222222222222");
		var html = $.ajax({
			url : url7,
			async : false
		}).responseText;
		var arr = new Array();
		arr = str.split("@");
		if (html != "" && html.length > 0) {
			p_content0 = html.replace("**WWWWW**", "1").replace("**JJJJJ**", "1")
					.replace("**KKKKK**", "1").replace("**LLLLL**", "1")
					.replace("**AAAAA**", arr[4]).replace("**BBBBB**", arr[3])
					.replace("**CCCCC**", arr[5]).replace("**DDDDD**", arr[1]).replace("**EEEEE**", arr[0])
					.replace("**FFFFF**", arr[2]).replace("**GGGGG**", arr[6]).replace("**HHHHH**", "支票")
					.replace("**IIIII**", "1").replace("**NNNNN**",arr[13]).replace("**OOOOO**", "")
					.replace("**PPPPP**", "").replace("**QQQQQ**", arr[8]).replace("**RRRRR**", arr[9])
					.replace("**SSSSS**", arr[10]).replace("**TTTTT**", arr[11]).replace("**UUUUU**", arr[12])
					.replace("**path1**", arr[14]).replace("**path2**", arr[15]);
		//		alert(p_content0);
			return p_content0;
		} else {
			return false;
		}
	} 	
	 else if (type == "4") {// 同城支付

		var html = $.ajax({
			url : url4,
			async : false
		}).responseText;
		var arr = new Array();
		arr = str.split("@");
		if (html != "" && html.length > 0) {
			p_content0 = html.replace("**AAAAA**", arr[0]).replace("**BBBBB**",
					arr[1]).replace("**CCCCC**", arr[2]).replace("**DDDDD**",
					arr[3]).replace("**EEEEE**", arr[4]).replace("**FFFFF**",
					arr[5]).replace("**GGGGG**", arr[6]).replace("**HHHHH**",
					arr[7]).replace("**IIIII**", "1").replace("**JJJJJ**", "1")
					.replace("**KKKKK**", "1").replace("**LLLLL**", "1")
					.replace("**path1**", arr[8]).replace("**MMMMM**", arr[0]);

			return p_content0;
		} else {
			return false;
		}
	} else if (type == "5") {// 结算业务

		// ajax请求
		var html = $.ajax({
			url : url5,
			async : false
		}).responseText;
		var arr = new Array();
		arr = str.split("@");
		if (html != "" && html.length > 0) {
			p_content0 = html.replace("**AAAAA**", arr[0]).replace("**BBBBB**",
					arr[1]).replace("**CCCCC**", arr[2]).replace("**DDDDD**",
					arr[3]).replace("**EEEEE**", arr[4]).replace("**FFFFF**",
					arr[5]).replace("**GGGGG**", arr[6]).replace("**HHHHH**",
					arr[7]).replace("**IIIII**", "1").replace("**JJJJJ**", "1")
					.replace("**KKKKK**", "1").replace("**LLLLL**", "1")
					.replace("**path1**", arr[8]).replace("**MMMMM**", arr[0]);

			return p_content0;
		} else {
			return false;
		}
	} else if (type == "6") {
		var html = $.ajax({
			url : url6,
			async : false
		}).responseText;
		var temp = "";// 需要替换的模版
		var tempstr = html;
		var myobj = str;
		var lengths = myobj.length;
		var pageNum = 1;// 每页要显示的数据条数
		var pageCount = 0;// 总页数
		if (lengths % pageNum > 0) {
			pageCount = (lengths - (lengths % pageNum)) / pageNum + 1;// 取模运算出总页数
		} else {
			pageCount = lengths / pageNum;
		}
		var A1;//出票人全称
		var A2;//出票人账号
		var A3;//开户银行
		var A4;//收款人全称
		var A5;//账号
		var A6;//开户银行
		var A7;//金额
		var A8;//票据种类
		var A9;//票据张数
		var A10;//票据号码
		var objlen = myobj.length;// 总长度
		var templen = 0;// 需要打印的长度
		if (html != "" && html.length > 0) {
			for ( var i = 0; i < pageCount; i++) {
				//var cc = document.getElementById("one1");
				//if(objlen%3==0){
				//	cc.style.display="none";
				//}else{
					//cc.style.display="block";
				//}
				if (pageCount == 1) {
					templen = myobj.length;
				} else {
					if (objlen >= templen) {
						templen = myobj.length - (myobj.length -

						pageNum * (i + 1));
						objlen = objlen - templen / (i + 1);
					} else {
						templen = myobj.length;
					}
				}
				for ( var bb = pageNum * i; bb < templen; bb++) {
					
					A1 = myobj[bb].PAYEENAME;
					A2 = myobj[bb].PAYEEACCNO;
					A3 = myobj[bb].PAYEEBANK;
					A4 = myobj[bb].DRAWEENAME;
					A5 = myobj[bb].DRAWEEACCNO;
					A6 = myobj[bb].DRAWEEBANK;
					A7 = myobj[bb].AMOUNT;
					A8 = myobj[bb].BILLTYPE;
					A9 = myobj[bb].BILLS;
					A10 = myobj[bb].BILLNO;
					
					var may1 = "";//亿
					var may2 = "";//千
					var may3 = "";//百
					var may4 = "";//十
					var may5 = "";//万
					var may6 = "";//千
					var may7 = "";//百
					var may8 = "";//十
					var may9 = "";//元
					var may10 = "";//角
					var may11 = "";//分
				if(A7.length>0){
				
					if(A7.indexOf(".") == -1){
						if(A7.length==1){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8="&nbsp;";
							may9 = A7.substring(A7.length,A7.length-1);
							may10= 0 ;
							may11= 0;
						}else if(A7.length==2){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==3){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==4){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==5){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5=A7.substring(A7.length-4,A7.length-5);
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==6){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4=A7.substring(A7.length-5,A7.length-6) ;
							may5=A7.substring(A7.length-4,A7.length-5);
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==7){
							may1="&nbsp;";
							may2="&nbsp;";
							may3=A7.substring(A7.length-6,A7.length-7);
							may4=A7.substring(A7.length-5,A7.length-6) ;
							may5=A7.substring(A7.length-4,A7.length-5);
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==8){
							may1="&nbsp;";
							may2=A7.substring(A7.length-7,A7.length-8);
							may3=A7.substring(A7.length-6,A7.length-7);
							may4=A7.substring(A7.length-5,A7.length-6) ;
							may5=A7.substring(A7.length-4,A7.length-5);
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}else if(A7.length==9){
							may1=A7.substring(A7.length-8,A7.length-9);
							may2=A7.substring(A7.length-7,A7.length-8);
							may3=A7.substring(A7.length-6,A7.length-7);
							may4=A7.substring(A7.length-5,A7.length-6) ;
							may5=A7.substring(A7.length-4,A7.length-5);
							may6=A7.substring(A7.length-3,A7.length-4);
							may7=A7.substring(A7.length-2,A7.length-3);
							may8=A7.substring(A7.length-1,A7.length-2);
							may9 = A7.substring(A7.length,A7.length-1);
							may10="0";
							may11="0";
						}
					}else{
						if(A7.length==1){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8="&nbsp;";
							may9 ="&nbsp;";
							may10= "&nbsp;";
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==2){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8="&nbsp;";
							may9 ="&nbsp;";
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==4){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8="&nbsp;";
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==5){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7="&nbsp;";
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==6){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5="&nbsp;";
							may6="&nbsp;";
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==7){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;" ;
							may5="&nbsp;";
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==8){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4="&nbsp;";
							may5=A7.substring(A7.length-7,A7.length-8);
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==9){
							may1="&nbsp;";
							may2="&nbsp;";
							may3="&nbsp;";
							may4=A7.substring(A7.length-8,A7.length-9) ;
							may5=A7.substring(A7.length-7,A7.length-8);
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==10){
							may1="&nbsp;";
							may2="&nbsp;";
							may3=A7.substring(A7.length-9,A7.length-10);
							may4=A7.substring(A7.length-8,A7.length-9) ;
							may5=A7.substring(A7.length-7,A7.length-8);
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==11){
							may1="&nbsp;";
							may2=A7.substring(A7.length-10,A7.length-11);
							may3=A7.substring(A7.length-9,A7.length-10);
							may4=A7.substring(A7.length-8,A7.length-9) ;
							may5=A7.substring(A7.length-7,A7.length-8);
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}else if(A7.length==12){
							may1=A7.substring(A7.length-11,A7.length-12);
							may2=A7.substring(A7.length-10,A7.length-11);
							may3=A7.substring(A7.length-9,A7.length-10);
							may4=A7.substring(A7.length-8,A7.length-9) ;
							may5=A7.substring(A7.length-7,A7.length-8);
							may6=A7.substring(A7.length-6,A7.length-7);
							may7=A7.substring(A7.length-5,A7.length-6);
							may8=A7.substring(A7.length-4,A7.length-5);
							may9 = A7.substring(A7.length-3,A7.length-4);
							may10= A7.substring(A7.length-1,A7.length-2);
							may11= A7.substring(A7.length,A7.length-1);
						}
					}
					
				}
					tempstr = html.replace("*A*", A1).replace("*B*", A4)
							.replace("*C*", A2).replace("*D*", A5).replace(
									"*E*", A3).replace("*F*", A6).replace(
									"*G*", numberToUpper(A7)).replace("*K*", A8).replace(
									"*L*", A9).replace("*M*", A10)
									.replace("*AA*", may1).replace("*BB*", may2)
							.replace("*CC*", may3).replace("*DD*", may4).replace(
									"*EE*", may5).replace("*FF*", may6).replace(
									"*GG*", may7).replace("*HH*", may8).replace(
									"*II*", may9).replace("*JJ*", may10).replace("*KK*", may11);
				}
				temp = temp + tempstr;
			}
		} else {
			return false;
		}
		return temp;

	}
}
// 测试js
function CreateFile(html) {
	var fso, tf;
	fso = new ActiveXObject("Scripting.FileSystemObject");// 获取对象
	tf = fso.CreateTextFile("c:\\testfile.txt", true);// 创建一个文件夹
	// 写一行，并且带有新行字符。
	// tf.WriteLine("Testing 1, 2, 3.") ;
	// 向文件写三个新行字符。
	// tf.WriteBlankLines(3) ;
	// 写一行。
	tf.Write(html);
	tf.Close();// 关闭
}

//返回金额的大写
function numberToUpper(numberValue) {

	var numberValue = new String(Math.round(numberValue * 100)); // 数字金额
	var chineseValue = ""; // 转换后的汉字金额
	var String1 = "零壹贰叁肆伍陆柒捌玖"; // 汉字数字
	var String2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; // 对应单位
	var len = numberValue.length; // numberValue 的字符串长度
	var Ch1; // 数字的汉语读法
	var Ch2; // 数字位的汉字读法
	var nZero = 0; // 用来计算连续的零值的个数
	var String3; // 指定位置的数值
	if (len > 15) {
		return "";
	}
	if (numberValue == 0) {

		chineseValue = "零元整";
		return chineseValue;

	}

	String2 = String2.substr(String2.length - len, len); // 取出对应位数的STRING2的值

	for ( var i = 0; i < len; i++) {

		String3 = parseInt(numberValue.substr(i, 1), 10); // 取出需转换的某一位的值
		//alert(String3);
		if (i != (len - 3) && i != (len - 7) && i != (len - 11)
				&& i != (len - 15)) {

			if (String3 == 0) {

				Ch1 = "";
				Ch2 = "";
				nZero = nZero + 1;

			} else if (String3 != 0 && nZero != 0) {

				Ch1 = "零" + String1.substr(String3, 1);
				Ch2 = String2.substr(i, 1);
				nZero = 0;

			} else {

				Ch1 = String1.substr(String3, 1);
				Ch2 = String2.substr(i, 1);
				nZero = 0;
			}
		} else { // 该位是万亿，亿，万，元位等关键位
			if (String3 != 0 && nZero != 0) {

				Ch1 = "零" + String1.substr(String3, 1);
				Ch2 = String2.substr(i, 1);
				nZero = 0;

			} else if (String3 != 0 && nZero == 0) {

				Ch1 = String1.substr(String3, 1);
				Ch2 = String2.substr(i, 1);
				nZero = 0;

			} else if (String3 == 0 && nZero >= 3) {

				Ch1 = "";
				Ch2 = "";
				nZero = nZero + 1;

			} else {

				Ch1 = "";
				Ch2 = String2.substr(i, 1);
				nZero = nZero + 1;

			}

			if (i == (len - 11) || i == (len - 3)) { // 如果该位是亿位或元位，则必须写上
				Ch2 = String2.substr(i, 1);
			}

		}
		chineseValue = chineseValue + Ch1 + Ch2;

	}

	if (String3 == 0) { // 最后一位（分）为0时，加上“整”
		chineseValue = chineseValue + "整";
	}
	return chineseValue;
}